package hlcache

import (
	"errors"
	"sync"
	"sync/atomic"
)

var KeyNotFound = errors.New("cache Key Not Found")
var ExceededMaxItem = errors.New("exceeded max cache items")
var ExceededMaxValueLength = errors.New("exceeded max cache value length")
var ExceededMaxKeyLength = errors.New("exceeded max cache key length")
var ErrorZeroLength = errors.New("key length was zero! ")

const (
	MaxValueLength = 8192
	MaxKeyLength   = 128
	MaxExpiredTime = 86400
	OneMinusNS     = 60000000000
	OneSecondNS    = OneMinusNS / 60
)

type CacheObj struct {
	dataMap     *sync.Map
	maxItemNum  int64
	currItemNum atomic.Int64
}

type cacheItem struct {
	expireTime int64
	cacheValue any
}
